package com.tudouji.project.bill.service.impl;

import java.math.BigDecimal;
import java.util.List;

import com.tudouji.common.utils.DateUtils;
import com.tudouji.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tudouji.project.bill.mapper.WhoutformitemMapper;
import com.tudouji.project.bill.domain.Whoutformitem;
import com.tudouji.project.bill.service.IWhoutformitemService;

/**
 * 出库单明细Service业务层处理
 * 
 * @author wf
 * @date 2021-01-12
 */
@Service
public class WhoutformitemServiceImpl implements IWhoutformitemService 
{
    @Autowired
    private WhoutformitemMapper whoutformitemMapper;

    /**
     * 查询出库单明细
     * 
     * @param guid 出库单明细ID
     * @return 出库单明细
     */
    @Override
    public Whoutformitem selectWhoutformitemById(String guid)
    {
        return whoutformitemMapper.selectWhoutformitemById(guid);
    }

    /**
     * 查询出库单明细列表
     * 
     * @param whoutformitem 出库单明细
     * @return 出库单明细
     */
    @Override
    public List<Whoutformitem> selectWhoutformitemList(Whoutformitem whoutformitem)
    {
        return whoutformitemMapper.selectWhoutformitemList(whoutformitem);
    }

    /**
     * 新增出库单明细
     * 
     * @param whoutformitem 出库单明细
     * @return 结果
     */
    @Override
    public int insertWhoutformitem(Whoutformitem whoutformitem)
    {
        whoutformitem.setCreateTime(DateUtils.getNowDate());
        whoutformitem.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserId());
        return whoutformitemMapper.insertWhoutformitem(whoutformitem);
    }

    /**
     * 修改出库单明细
     * 
     * @param whoutformitem 出库单明细
     * @return 结果
     */
    @Override
    public int updateWhoutformitem(Whoutformitem whoutformitem)
    {
        return whoutformitemMapper.updateWhoutformitem(whoutformitem);
    }

    /**
     * 批量删除出库单明细
     * 
     * @param guids 需要删除的出库单明细ID
     * @return 结果
     */
    @Override
    public int deleteWhoutformitemByIds(String[] guids)
    {
        return whoutformitemMapper.deleteWhoutformitemByIds(guids);
    }

    /**
     * 删除出库单明细信息
     * 
     * @param guid 出库单明细ID
     * @return 结果
     */
    @Override
    public int deleteWhoutformitemById(String guid)
    {
        return whoutformitemMapper.deleteWhoutformitemById(guid);
    }

    @Override
    public BigDecimal sumCountByOrderIdAndSpeId(Whoutformitem outItem) {
        return whoutformitemMapper.sumCountByOrderIdAndSpeId(outItem);
    }

    @Override
    public Whoutformitem selectWhoutformitemBySpId(Whoutformitem outItem) {
        return whoutformitemMapper.selectWhoutformitemBySpId(outItem);
    }

    @Override
    public Whoutformitem selectWhoutItemBySpeId(Whoutformitem outItem) {
        return whoutformitemMapper.selectWhoutItemBySpeId(outItem);
    }

}
